package com.cloud.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName HuangXiangXiang
 * @Date 2020/4/5 1:45
 * @Version V1.0
 **/

@Configuration
public class MySelfRule {

    /**
     * 自定义负载均衡
     *
     * @return
     */

    @Bean
    public IRule myRule() {
        return new RandomRule();   //随机轮询
    }

}
